package com.han.verifycode.data.area;

import com.han.verifycode.data.Area;
import com.han.verifycode.data.Position;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 矩形范围
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RectangleArea extends Area {
    /**
     * 正 矩形
     * @param p
     * @param width
     * @param height
     */
    public RectangleArea(Position p, int width, int height) {
        this.p1 = p;
        this.p2 = new Position(p.getX() + width, p.getY());
        this.p3 = new Position(p.getX(), p.getY() + height);
        this.p4 = new Position(p.getX() + width, p.getY() + height);
    }

    /**
     * 左上角
     */
    private Position p1;


    /**
     * 右上角
     */
    private Position p2;
    /**
     * 左下角
     */
    private Position p3;

    /**
     * 右下角
     */
    private Position p4;


    public boolean verifyPosition(Position position) {

        return false;
    }
}
